home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
cg
/
boxmaker.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
2KB
|
83 lines
/* BoxMaker -- Save Boxes to rexx macro */
/* By Bob Caron On 12/24/1994 NewTek, Inc. */
/* <It's fun to code while people argue outside your office*/
/* try it sometime!> */
call addlib(CG_AREXX,0)
filnam = 'ENV:BoxMaker.state'
version = 'BoxMaker v1.4'
if (exists(filnam)) then do
if (~open(state, filnam, 'R')) then break
if (readln(state) ~= version) then break
file=readln(state)
end
call close state
if file="FILE" | file="" then
file="Toaster:Arexx/CG/BoxMakerScripts/Boxes.rexx"
if lastpos('/',file,length(file)-1)~=0 then do
filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
path=left(file,(lastpos('/',file,length(file))-1))
end
else do
filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
path=left(file,(lastpos(':',file,length(file))))
end
outfile=REQ_FILE("Save Box Attributes As...",filenam,path)
if outfile="" then
exit
file=script
if (open(state, filnam, 'W')) then do
call writeln state, version
call writeln state, outfile
call close state
end
if exists(outfile) then do
x=req_ask("Write Over File '"||outfile||"'?")
if x=0 then do
x=req_tell("Canceled")
exit
end
end
if (~open(outfd,outfile,W)) then do
call REQ_TELL("Can't open output:",outfile)
exit
end
writeln(outfd,"/* "||outfile" -- A Box Attribute Setter*/")
writeln(outfd,"/* By A. Random User ©1994 NewTek, Inc. */")
writeln(outfd,"/* (Based on a program by Bob Caron.) */")
writeln(outfd,"")
writeln(outfd,"call addlib(CG_AREXX,0)")
writeln(outfd,"")
writeln(outfd,"call pickpage(not)")
writeln(outfd,"call set_char(face,commonthin.10)")
current_line=1
total_lines=GET_PAGE(SIZE)
do while current_line <= total_lines
call SET_LINE(current_line)
line_pos=GET_LINE(SPOT)
current_line=current_line+1
boxspot=translate(GET_RECT(SPOT),","," ")
boxsize=translate(GET_RECT(SIZE),","," ")
if boxsize~="0,0" & boxspot~="0,0" then do
writeln(outfd,"CALL MAKELINE()") /* This is ugly but it works */
writeln(outfd,"CALL MAKELINE()") /* Just a problem with CG Arexx ;) */
writeln(outfd,"CALL MAKERECT("||boxspot||","||boxsize||")")
end
end
writeln(outfd,"CALL REMLIB(CG_AREXX)")
call close(outfd)
call REQ_TELL("Saved...")
call REMLIB(CG_AREXX)
exit